<?php if (!defined('THINK_PATH')) exit();?><!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>Title</title>
</head>
<body>这是if语句的测试:<br>
 <?php if($sex == "男" ): ?>你是我的好朋友
 <?php elseif($sex == "女" ): ?> 
 你是女人
 <?php else: ?>
 你是谁啊！<?php endif; ?>
<?php echo ((isset($name) && ($name !== ""))?($name):'salamat kapisiz!'); ?><br>

<!-- 这是foreach循环语句的测试<br> -->
 <!--  <?php if(is_array($kk)): foreach($kk as $k=>$val): echo ($k); ?>=><?php echo ($val); ?><br><?php endforeach; endif; ?> -->
 <!-- <?php if(is_array($kk)): foreach($kk as $k=>$vo): echo ($k); ?>=><?php echo ($vo); ?><br><?php endforeach; endif; ?> --> 
   <!-- <?php if(is_array($kk)): foreach($kk as $k=>$vo): echo ($vo[1]); ?><br><?php endforeach; endif; ?>  -->
    <!-- <?php if(is_array($kk)): foreach($kk as $k=>$vo): echo ($k); ?>:<?php echo ($vo); ?><Br><?php endforeach; endif; ?> <hr> -->             
<!-- <?php if(is_array($arr)): foreach($arr as $key=>$val1): if(is_array($val1)): foreach($val1 as $k=>$val2): echo ($k); ?>:<?php echo ($val2); ?><br><?php endforeach; endif; endforeach; endif; ?> -->
<!-- <?php if(is_array($arr1)): foreach($arr1 as $k=>$val): echo ($k); ?>:<?php echo ($val["name"]); ?>的家乡是：
	<?php echo ($val["city"]); ?>，性别是：
	<?php echo ($val["sex"]); ?><br><?php endforeach; endif; ?> -->
<!-- //二维数组中的应用-->
<!-- <?php if(is_array($arr)): $k = 0; $__LIST__ = $arr;if( count($__LIST__)==0 ) : echo "" ;else: foreach($__LIST__ as $key=>$v1): $mod = ($k % 2 );++$k; if(is_array($v1)): $i = 0; $__LIST__ = $v1;if( count($__LIST__)==0 ) : echo "" ;else: foreach($__LIST__ as $key=>$v2): $mod = ($i % 2 );++$i; echo ($k); ?>:<?php echo ($v2); ?><br><?php endforeach; endif; else: echo "" ;endif; endforeach; endif; else: echo "" ;endif; ?> --> 
 <!-- 一维数组中的应用 -->
<!-- <?php if(is_array($kk)): $k = 0; $__LIST__ = $kk;if( count($__LIST__)==0 ) : echo "" ;else: foreach($__LIST__ as $key=>$hc): $mod = ($k % 2 );++$k; echo ($k); ?>:<?php echo ($hc); ?><br><?php endforeach; endif; else: echo "" ;endif; ?>  -->
  <!--  二维关联数组中的应用 -->
    <!-- <?php if(is_array($arr1)): $k = 0; $__LIST__ = $arr1;if( count($__LIST__)==0 ) : echo "" ;else: foreach($__LIST__ as $key=>$val): $mod = ($k % 2 );++$k; echo ($k); ?>:<?php echo ($val["name"]); ?>的家乡是:
    	<?php echo ($val["city"]); ?>,性别是:
         <?php echo ($val["sex"]); ?><br><?php endforeach; endif; else: echo "" ;endif; ?> -->
    <!-- 支持输出查询结果中的部分数据，例如输出其中的第5～15条记录 -->
    <?php if(is_array($arr1)): $i = 0; $__LIST__ = array_slice($arr1,1,1,true);if( count($__LIST__)==0 ) : echo "" ;else: foreach($__LIST__ as $key=>$val): $mod = ($i % 2 );++$i; echo ($val["name"]); ?>的家乡是:<?php echo ($val["city"]); ?>,性别是:<?php echo ($val["sex"]); endforeach; endif; else: echo "" ;endif; ?>
</body>
</html>